<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>一本财经-金融科技风控大会</title>
    <meta http-equiv="Expires" CONTENT="0"> 
	<meta http-equiv="Cache-Control" CONTENT="no-cache"> 
	<meta http-equiv="Pragma" CONTENT="no-cache"> 
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="shortcut icon" href="<%=basePath%>images/jbhicon.ico">
	<link rel="stylesheet" href="<%=basePath%>js/bootstrap-3.3.6/dist/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>css/mydialog.css" />
	
	<script type="text/javascript" src="<%=basePath%>js/common/jquery-2.1.0.js" charset="utf-8"></script>
	<script type="text/javascript" src="<%=basePath%>js/bootstrap-3.3.6/dist/js/bootstrap.min.js" charset="utf-8"></script>
	<script type="text/javascript"src="<%=basePath%>js/common/jquery.form.js"></script>
	<script type="text/javascript"src="<%=basePath%>js/common/dialog.3.1.min.js"></script>
	
	<script type="text/javascript">
		if (window != top)
		top.location.href = location.href;
	
		<%-- if(parent!=null && parent.window.indexPage == 1){
			parent.window.location.href = "<%=path%>/login";
		} --%>
		
		function login(){
			var username=$("input[name='username']").val();
			var password=$("input[name='password']").val();
			if(username==""){
				 Dialog({
		                "msg": '<div class="D_alert">请输入账号...</div>',
		                "title": "提示",
		                "showButtons": true,
		                "cancelButton": false,
		                "onReady": function(that) {
		                	$("body").off("keydown");
		                	$("body").keydown(function(){
		                	$("body").find(".D_submit").click();
	                		});
		                }, 
				 })
		         $('#loginForm')[0].reset();
		    }else if(password==""){
		   	 Dialog({
	                "msg": '<div class="D_alert">请输入密码...</div>',
	                "title": "提示",
	                "showButtons": true,
	                "cancelButton": false,
	                "onReady": function(that) {
	                	$("body").off("keydown");
	                	$("body").keydown(function(){
	                	$("body").find(".D_submit").click();
                		});
	                }, 
			 })
			  $('#loginForm')[0].reset();
			
		    }else {
		    	var form = document.getElementById("loginForm");
		    	form.method = "post";
		    	form.action = "checkLogin";
		    	form.submit();
		    }
			
		}
		/* 登录不成功提示淡出 */
		$(document).ready(function(){
			$("div").children("div").find("input").first().focus(function(){
					    $("#userFadeOut").fadeOut();
			  })
			 $("div").find("div").find("input").last().focus(function(){
					    $("#pwdFadeOut").fadeOut();
			  }) 
			}); 
		
	/* 	浏览器后退重新加载页面
		
		Response.Buffer=true; 

		Response.ExpiresAbsolute=Now()-1; 

		Response.Expires=0; 

		Response.CacheControl="no-cache"; 
 */
 
/* 	
	 $(document).ready(function(){
		//登录
		$("#login-btn").click(function(){
			if($("input[name='username']").val()==""){
		         alert("请输入登录账号！");
		         $('#loginForm')[0].reset();
		    }else if($("input[name='password']").val()==""){
				alert("请输入登录密码！");
			}else{
		    	var form = document.getElementById("loginForm");
		    	form.method = "post";
		    	form.action = "checkLogin";
		    	form.submit();
		    }
		});
	}); */
    </script>	
	<script>
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "https://hm.baidu.com/hm.js?43e3b466a7accb875cd64b971a9b48f0";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
	
	</script>
  </head>
  <body onkeydown="if(event.keyCode==13){login();}">
  
  	<form id="loginForm">
		<div class="main">
			<div id="header-box">
				<div>
					<img src="images/bg-denglu.png" style="width: 100%;" />
				</div>
			</div>
			<div id="login-img-box">
					<a id="login-btn" style="display: block;cursor: pointer;" onclick="login();">						
						登录	
					</a>
			</div>
			
			<div class="form-box">
				<div id="js-login-form">
      				<%
      					String message=(String)request.getAttribute("error"); 
      				%>
					<label class="form-item form-phone">
        				<em></em>
        				<input type="text" name="username" class="form-item-in verify-bare1" placeholder="请输入登录账号" maxlength="16">
		      			<div id="userFadeOut" style="display: inline-block;color: red;font-size: 14px;position: absolute;top: 0;right: 13px;">
			      			<%=(message==null ? "" : message) %>
						</div>
      				</label>
					<%
      					String message1=(String)request.getAttribute("error1"); 
      				%>
					<label class="form-item form-password">
        				<em></em>
        				<input type="password" name="password" class="form-item-in verify-bare2" placeholder="请输入登录密码" onkeyup="" maxlength="16">
      					<div id="pwdFadeOut" style="display: inline-block;color: red;font-size: 14px;position: absolute;top: 0;right: 13px;">
			      			<%=(message1==null ? "" : message1) %>
						</div>
      				</label>
				</div>
			</div>
		</div>
		</form>
	</body>
</html>